﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TradeDataAPI.Core.Common
{

    /// <summary>
    /// 描述帮助类
    /// </summary>
    public class DescriptionHelper
    {

        private static readonly HashSet<string> InvalidDescriptions = new HashSet<string> { "1", "无", "null", "空" };


        /// <summary>
        /// 验证描述是否有效
        /// </summary>
        /// <param name="description"></param>
        /// <returns></returns>
        public static (bool isValid, string message) ValidateDescription(string description)
        {
            if (InvalidDescriptions.Contains(description)|| string.IsNullOrWhiteSpace(description))
            {
                return (false, "输入的描述无效");
            }
            return (true, "输入的描述有效");
        }

    }
}
